<script setup>
import Header from '../pages/Header.vue';
import Aside from '../pages/Aside.vue';
import {useCounterStore} from '../store/tag';
//监测路由变化
import {useRoute,onBeforeRouteUpdate} from 'vue-router';
const use = useCounterStore();
const route = useRoute();
onBeforeRouteUpdate((from,to)=>{
  //console.log(route.name);
  //use.addTags(from.name)
  use.addTags(to.name)
})
</script>


<template>
  <div class="common-layout">
    <el-container>
      <el-header>
        <Header></Header>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <Aside></Aside>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>

</template>

<style scoped>

</style>
